<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="shortcut icon" href="favicon.ico"/> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet"/>
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet"/>

    <!-- Data Tables -->
    <link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet"/>

    <link href="css/animate.css" rel="stylesheet"/>
    <link href="css/style.css?v=4.1.0" rel="stylesheet"/>

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>商家列表</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="wl_seller.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="wl_seller.html#">选项1</a>
                            </li>
                            <li><a href="wl_seller.html#">选项2</a>
                            </li>
                        </ul>

                    </div>
                </div>
                <div class="ibox-content">
                    <form action="wl_seller_fuzzQuery" method="post">
                        <table>
                            <tr>
                    <td><input id="shopname" class="form-control" type="text" placeholder="请输入商家名字" name="sname"/></td>
                      <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                      <td><select required="required" class="form-control m-b"  id="stacid" name="stac">
                        <option th:value="-1">请选择状态</option>
                        <option th:if="selected" th:text="无效" th:value="0"></option>
                        <option th:if="selected" th:text="有效" th:value="1"></option>
                    </select>
                     </td>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
                     <td><button type="submit" class="btn btn-default" onclick="a()">查询</button></td>
                            </tr>
                        </table>
                    </form>
                    <table class="table table-responsive table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>商家名称</th>
                            <th>状态</th>
                            <th>创建人</th>
                            <th>创建时间</th>
                            <th>修改人</th>
                            <th>修改时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="user:${list}" class="gradeX">
                            <td th:text="${user.sellername}"></td>
                            <td th:text="${user.status}"></td>
                            <td th:text="${user.createbycode}"></td>
                            <td th:text="${#dates.format(user.createtime,'yyyy-MM-dd')}"></td>
                            <td th:text="${user.updatebycode}"></td>
                            <td th:text="${#dates.format(user.updatetime,'yyyy-MM-dd')}"></td>
                            <td>
                                <!-- 修改 -->
                                <a th:if="${user.status}==1" th:href="@{../wl_seller_findbyid(id=${user.id})}">
                                    <span class="glyphicon glyphicon-edit"></span>
                                </a>
                                <!-- 删除 -->
                                <a  href="wl_seller_remove" th:href="@{../wl_seller_remove(id=${user.id})}" onclick="return confirm('确定删除吗？')">
                                    <span class="glyphicon glyphicon-remove"></span>
                                </a>
                                <!-- 新增 -->
                                <a th:href="@{wl_seller_insert.html }">
                                    <span class="glyphicon glyphicon-plus"></span>
                                </a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>



<script src="js/plugins/jeditable/jquery.jeditable.js"></script>

<!-- Data Tables -->
<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>

<!-- 自定义js -->
<script src="js/content.js?v=1.0.0"></script>


<!-- Page-Level Scripts -->
<script>
    function a() {
       if($('#shopname').val()==null || $('#shopname').val()==""){
            location.href='wl_seller_getAll';
       }
    }


    $(document).ready(function () {
        $('.dataTables-example').dataTable();

        /* Init DataTables */
        var oTable = $('#editable').dataTable();

        /* Apply the jEditable handlers to the table */
        oTable.$('td').editable('../example_ajax.php', {
            "callback": function (sValue, y) {
                var aPos = oTable.fnGetPosition(this);
                oTable.fnUpdate(sValue, aPos[0], aPos[1]);
            },
            "submitdata": function (value, settings) {
                return {
                    "row_id": this.parentNode.getAttribute('id'),
                    "column": oTable.fnGetPosition(this)[2]
                };
            },

            "width": "90%",
            "height": "100%"
        });


    });

    function fnClickAddRow() {
        $('#editable').dataTable().fnAddData([
            "Custom row",
            "New row",
            "New row",
            "New row",
            "New row"]);

    }
   function de_sure() {
           var shanchu = confirm("你确定要删除吗？");
           if (shanchu == true) {
               return true;
           } else {
               return false;
           }

   }
    
</script>

<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<!--统计代码，可删除-->

</body>

</html>
